{$CLEO .cs}
0000:



4@ = 0
while true
    wait 0
    28@ = false
                                                                                                                                                                                                       
    #patriot.Load                                                                                                                                                                                                     
    #fam3.load                                                                                                                                                                                                         
    #mp5lng.load                                                                                                                                                                                                       
    038b:                                                                                                                                                                                                              
    while true                                                                                                                                                                                                         
    repeat                                                                                                                                                                                                             
    wait 0                                                                                                                                                                                                             
    until if player.Defined(0)                                                                                                                                                                                         
    09E8: $GYMFIGHT_INTERIOR = actor $PLAYER_ACTOR active_interior                                                                                                                                                     
    if $GYMFIGHT_INTERIOR == 0
    then                                                                                                                                                                                                               
        if 28@ == false                                                                                                                                                                                                
        then      
            IF ACTOR.Driving($PLAYER_ACTOR)
            THEN
                IF 847A:   not actor $PLAYER_ACTOR driving_bike 
                THEN 
                    3@ = ACTOR.CurrentCar($PLAYER_ACTOR)                                                                                                                                       
                    24@ = actor.Create(gang2, #fam3, 6@,7@,8@)                                                                                                                                                               
                    Actor.SetImmunities(24@, 0, 0, 0, 0, 0)                                                                                                                                    
                    Actor.Health(24@) = 1000                                                                                                                                                                   
                    0619: enable_actor 24@ collision_detection 0                                                                                                                                                           
                    27@ = Object.Create(2985, 0.0, 0.0, -25.0)                                                                                                                                                             
                    Object.CollisionDetection(27@) = False                                                                                                                                                                 
                    0400: store_coords_to 0@ 1@ 2@ from_actor 27@ with_offset 0.0 2.0 1.1                                                                                                                                  
                    Object.PutAt(27@, 0@ 1@ 2@)
                    
                    IF 04A9:   actor $PLAYER_ACTOR driving_heli
                    THEN
                        0681: attach_object 27@ to_car 3@ with_offset -1.2 -0.2 -0.6 rotation 0.0 0.0 0.0                                                                                                                                 
                        06A7: put_actor 24@ into_turret_on_car 3@ at_car_offset 0.0 -1.5 1.0 position 1 shooting_angle -109.0 282.0 with_weapon 0                                                                                        
                        0638: AS_actor 24@ stay_put 1                                                                                                                                                                                   
                        04F4: put_actor 24@ into_turret_on_object 27@ offset_from_object_origin -0.5 0.0 0.8 orientation 100 both_side_angle_limit 282.0 lock_weapon 0                          
                    ELSE
                        0681: attach_object 27@ to_car 3@ with_offset 0.0 -1.0 0.3 rotation 0.0 0.0 0.0                                                                                                                        
                        06A7: put_actor 24@ into_turret_on_car 3@ at_car_offset 0.0 -1.5 0.9 position 1 shooting_angle 100.0 360.0 with_weapon 0                                                                               
                        0638: AS_actor 24@ stay_put 1                                                                                                                                                                          
                        04F4: put_actor 24@ into_turret_on_object 27@ offset_from_object_origin -0.5 0.0 0.7 orientation 0 both_side_angle_limit 360.0 lock_weapon 0                                                                                                                                                                                                                        
                    END
                    072F: enable_car 3@ stuck_check_distance 0.5 time 4000 and_restore_if stuck 1 flipped 1 unk_place_on_road_properly 1 to_path 7 // extended 03CC                                                                                                             
                    0190: add_car 3@ to_flipped_check // 6 max                                                                                                                                                                                                     
                    28@ = true                                                                                                                                                                                                 
                    21@ = 1
                END
            END                                                                                                                                                                                                   
        end                                                                                                                                                                                                            
        if 28@ == true                                                                                                                                                                                                 
        then                                                                                                                                                                                                           
            if 056E:   car 3@ defined                                                                                                                                                                                  
            then                                                                                                                                                                                                       
                if 056D:   actor 24@ defined                                                                                                                                                                          
                then 
                    if not Actor.Animation(24@) == "DRIVE_R_SLOW"
                    then 0812: AS_actor 24@ perform_animation "DRIVE_R_SLOW" "ped" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1                                                                                                                                                                                                                       
                    end
                    if 03ca:   actor 27@ defined                                                                                                                                                                       
                    then object.StorePos(27@, 26@, 25@, 23@)                                                                                                                                                            
                    end
                    if 00E1:   player 0 pressed_key 17 
                    then 21@ = 2
                         9@ = 50                                                                                                                                                                                             
                        gosub @get_criminal8

                    else
                        gosub @get_criminal8
                    end                                                                                                                                                                                
                    if 056D:   actor 31@ defined                                                                                                                                                                       
                    then                                                                                                                                                                                               
                        if not actor.Dead(31@)                                                                                                                                                                         
                        jf @sss8                                                                                                                                                                                                 
                        Actor.StorePos(31@, 10@, 20@, 2@)
                        :sss8
                    end                                                                                                                                                              
                    050A: 1@ = distance_between_XYZ 26@ 25@ 23@ and_XYZ 10@ 20@ 2@                                                                                                                                 
                    0087: 13@ = 2@ // (float)                                                                                                                                                                       
                    0063: 13@ -= 23@ // (float)                                                                                                                                                                     
                    0073: 13@ /= 1@ // (float) = sin                                                                                                                                                                
                    0087: 14@ = 13@ // (float)                                                                                                                                                                       
                    0087: 30@ = 13@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    13@ /= 6.0                                                                                                                                                                                      
                    005B: 30@ += 13@ // (float)                                                                                                                                                                     
                    13@ *= 6.0                                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    13@ *= 0.075                                                                                                                                                                                    
                    005B: 30@ += 13@ // (float)                                                                                                                                                                     
                    13@ /= 0.075                                                                                                                                                                                    
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    006B: 13@ *= 14@ // (float)                                                                                                                                                                      
                    13@ *= 0.0446                                                                                                                                                                                   
                    005B: 30@ += 13@ // (float)  arcsinX = X + (X^3)/6 + (X^5)*3/40 + (X^7)*15/336                                                                                                                  
                    30@ *= -57.296 // ia?aei ?aeau  a?anu                                                                                                                                                  
                    30@ += 350.0                                                                                                                                                                                   
                    0063: 10@ -= 26@ // (float)                                                                                                                                                                    
                    0063: 20@ -= 25@ // (float)                                                                                                                                                                    
                    0604: get_Z_angle_for_point 10@ 20@ store_to 11@  // 1 ia?aiao? - x2-x1   2 ia?aiao? - y2-y1                                                                                                   
                    //-----------------------------------------------------------uenyai niauaey i nyi X e Y                                                                                                  
                    0174: 12@ = car 3@ Z_angle                                                                                                                                                                     
                    0063: 11@ -= 12@ // (float)                                                                                                                                                                    
                    11@ += 270.0   // ino ieeaa ao ?aniaaaony ni?aa o y ioee                                                                                                                    
                    02F6: 10@ = cosine 11@ // (float) nen                                                                                                                                                        
                    02F7: 20@ = sine 11@ // (float) enen                                                                                                                                                        
                    10@ *= -0.3                                                                                                                                                                                    
                    20@ *= 0.4                                                                                                                                                                                     
                    //-----------------------------------------------------------i?ee?aiyai ieeaa                                                                                                               
                    11@ -= 180.0                                                                                                                                                                                   
                    if 30@ < 320.0                                                                                                                                                                                 
                    then 30@ = 320.0                                                                                                                                                                               
                    end                                                                                                                                                                                            
                    if 30@ > 395.0                                                                                                                                                                                 
                    then 30@ = 395.0                                                                                                                                                                               
                    end                                                                                                                                                                                            
                    if and                                                                                                                                                                                         
                    0471:   actor 24@ near_object_in_rectangle 27@ radius 2.0 2.0 sphere 0                                                                                                                         
                    03ca:   actor 27@ defined                                                                                                                                                                      
                    then //0acd: "000" 100
                        0087: 19@ = 30@
                        19@ += 10.0
                        
                        IF 04A9:   actor $PLAYER_ACTOR driving_heli
                        THEN 0681: attach_object 27@ to_car 3@ with_offset -1.2 -0.2 -0.6 rotation 0.0 19@ 11@
                        ELSE 0681: attach_object 27@ to_car 3@ with_offset 0.0 -1.0 0.3 rotation 0.0 19@ 11@
                        END
                                                                                                                                 
                        11@ = object.Angle(27@)                                                                                                                                                                    
                        11@ -= 94.0                                                                                                                                                                                
                        actor.Angle(24@) = 11@                                                                                                                                                                     
                        if not Actor.Animation(24@) == "DRIVE_R_SLOW"
                        then 0812: AS_actor 24@ perform_animation "DRIVE_R_SLOW" "ped" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1                                                                                                                                                                                                                       
                        end                                                                                                                                                                      
                        if 21@ == 2                                                                                                                                                                               
                        then 
                            if 056D:   actor 31@ defined                                                                                                                                                                       
                            then                                                                                                                                                                                   
                                if not actor.Dead(31@)                                                                                                                                                             
                                then               
                                    0393: actor 24@ perform_animation "DRIVE_R_SLOW" at 1.0 times_normal_rate                                                                                          
                                    0208: 5@ = random_float_in_ranges -1.0 1.0                                                                                                                                                                                                            
                                    0208: 6@ = random_float_in_ranges -1.0 1.0                                                                                                                                     
                                    0400: store_coords_to 26@ 25@ 18@ from_car 27@ with_offset 0.8 0.0  1.1                                                                                                        
                                    04C4: store_coords_to 10@ 20@ 23@ from_car 31@ with_offset 5@ 0.0 6@                                                                                               
                                    06BC: create_M4_shoot_from 26@ 25@ 18@ target 10@ 20@ 23@ energy 100                                                                                               
                                    066E: create_particle "GUNFLASH" attached_to_object 27@ with_offset 0.8 0.0  1.1 rotation  0.866024961519 0 0.500000766025 flag 1 handle_as 0@                                 
                                    064C: make_particle 0@ visible                                                                                                                                                 
                                    064F: remove_references_to_particle 0@                                                                                                                                         
                                    097B: play_audio_at_object 27@ event 1157                                                                                                                          
                                else 14@ = false
                                end
                            else 14@ = false
                            end            
                        end                                                                                                                                                                                        
                        IF 21@ == 1                                                                                                                                                                               
                        THEN //0acd: "firing" 100                                                                                                                                                                                    
                            IF NOT 9@ >= 50 //SHOTING TIME                                                                                                                                                                      
                            THEN 9@ += 1                                                                                                                                                                         
                            ELSE 21@ = 2                                                                                                                                                                          
                            END                                                                                                                                                                                    
                        END                                                                                                                                                                                        
                        IF 21@ == 2                                                                                                                                                                               
                        THEN //0acd: "wait" 100   
                            0393: actor 24@ perform_animation "DRIVE_R_SLOW" at 0.0 times_normal_rate                                                                                                                                                                                            
                            IF 9@ > 0                                                                                                                                                                            
                            THEN 9@ -= 1                                                                                                                                                                         
                            end                                                                                                                                                                                    
                        END                                                                                                                                                                                        
                        IF 9@ == 1                                                                                                                                                                               
                        THEN 21@ = 1                                                                                                                                                                              
                        END                                                                                                                                                                                        
                    end                                                                                                                                                                                            
                end
                0AB4: 16@ < 248                                                                                                                                                                                                   
                if or                                                                                                                                                                                                  
                    8202:   not actor $PLAYER_ACTOR near_car 3@ radius 200.0 200.0 sphere 0                                                                                                                            
                    car.Wrecked(3@)
                    16@ == TRUE                                                                                                                                                                                    
                then                                                                                                                                                                                                   
                    28@ = false                                                                                                                                                                                        
                    if 056D:   actor 24@ defined                                                                                                                                                                       
                    then  0465: remove_actor 24@ from_turret_mode 
                        Actor.RemoveReferences(24@)                                                                                                                                                                   
                    end                                                                                                                                                                                                      
                    IF 03CA:   object 27@ exists                                                                                                                                                                       
                    THEN object.RemoveReferences(27@)                                                                                                                                                                  
                    END                                                                                                                                                                                                
                    end_thread                                                                                                                                                                                               
                end                                                                                                                                                                                                    
            end                                                                                                                                                                                                        
            if actor.Dead(24@)                                                                                                                                                                             
            then                                                                                                                                                                                               
                if 056D:   actor 24@ defined                                                                                                                                                              
                then 0465: remove_actor 24@ from_turret_mode 
                    Actor.RemoveReferences(24@)                                                                                                                                                               
                end                                                                                                                                                                                            
            end                                                                                                                                                                                                       
        end                                                                                                                                                                                                            
    end                                                                                                                                                                                                                
end

:get_criminal8
4@ = 0
if or
   14@ == false
   4@ >= 150
then 4@ = 0
    Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@)                                                                            
    if 0AE1: 31@ = random_actor_near_point 0@ 1@ 2@ in_radius 200.0 find_next 1 pass_deads 0 //IF and SET                
    then                                                                                                                                                              
        IF NOT 31@ == -1                                                                                                                                               
        then                                                                                                                                        
            IF 056D:   actor 31@ defined                                                                                                                               
            then                                                                                                         
                089F: get_actor 31@ pedtype_to 13@
                IF not pLAYER.WantedLevel(0) > 0
                THEN 
                    if not 13@ == 8                                
                                                 
                    then 14@ = true                                 
                    else                                            
                        31@ = -1                                    
                        14@ = false                                 
                    end
                else                                             
                    if not 13@ == 8                   
                                         
                    then 14@ = true                    
                    else                               
                        31@ = -1                       
                        14@ = false                    
                    end                                
                END                                                                                         
            end                                                                                                          
        end                                                                                                              
    end                                                                                                                  
end
return
end_thread